﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

    public class CHITIET_PHIEUXUAT_BUSSINESS 
    {
        public DataSet GET_BY_ID_PX(CHITIET_PHIEUXUAT_ENTITY CTPX)
        {
            string ACTION = "LIST_BYID_PX";
            return CHITIET_PHIEUXUAT_DATAACCESS.GETDATATABLE(ACTION, CTPX);
        }
    
        public void Them_CTCTPX(CHITIET_PHIEUXUAT_ENTITY CTPX)
        {
            string ACTION = "INSERT";
            CHITIET_PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, CTPX);
        }
        public void Sua_CTCTPX(CHITIET_PHIEUXUAT_ENTITY CTPX)
        {
            string ACTION = "UPDATE";
            CHITIET_PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, CTPX);
        }
        public void Luu_CTCTPX(CHITIET_PHIEUXUAT_ENTITY CTPX)
        {
            string ACTION = "SAVE";
            CHITIET_PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, CTPX);
        }
        public void Xoa_CTCTPX(CHITIET_PHIEUXUAT_ENTITY CTPX)
        {
            string ACTION = "DELETE";
            CHITIET_PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, CTPX);
        }
        public Hashtable HashList_CTCTPX(CHITIET_PHIEUXUAT_ENTITY CTPX)
        {
            string ACTION = "LIST";
            Hashtable ht = new Hashtable();
            DataSet ds = CHITIET_PHIEUXUAT_DATAACCESS.GETDATATABLE(ACTION, CTPX);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ht.Add(dr["MACTPX"], dr["MACTPX"]);
                }
            }
            return ht;
        }
    }
